package com.zy.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 虚拟路径配置类
 * @author 张宇
 * @date 2021/8/2 15:07
 */
@Configuration
public class UploadFilePathConfig implements WebMvcConfigurer
{

    /**
     * window 的
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry)
    {
        registry.addResourceHandler("/test/**").addResourceLocations("file:E:/test/");
    }

//    /**
//     * Linux 的
//     * @param registry
//     */
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry)
//    {
//        registry.addResourceHandler("/test/**").addResourceLocations("file:/test/");
//    }

}
